﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using TR.AppService.AppService.WHOM_Selected;
using TR.AppService.Dto;
using TR.AppService.Dto.WHOMDto;
using TR.Domain.Entity.WHOB;

namespace TR.WebApi.Controllers.WHOM_SelectControllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class WHOM_SelectController : ControllerBase
    {
        private IWHOM_SelectAppService Iws;

        public WHOM_SelectController(IWHOM_SelectAppService Iws)
        {
            this.Iws = Iws;
        }

        //分页条件查询
        [HttpGet]
        public async Task<DtoFenYe<WHOB_Select>> WHOMWhereSelectAsync(int mys,int dqy,string? qsj,string? hsj,[FromQuery] WHOM_SelectDto ws)
        {
            return await Iws.WHOB_FenYeSelect(mys, dqy, qsj, hsj, ws);
        }

        //逻辑删除 多条
        [HttpPut]
        public async Task<bool> WHOMDeleteAsync(List<int> isdel)
        {
            return await Iws.WHOBDeleteAsync(isdel);
        }

        //批量修改状态
        [HttpPut]
        public async Task<bool> StateUpdateAsync(List<int> Bian,char zt)
        {
            return await Iws.StaticUpdateAsync(Bian, zt);
        }

        //批量审核
        [HttpPut]
        public async Task<bool> SHUpadteAsync(List<int> Bian, char states, string sureman, string suredate, string remack)
        {
            return await Iws.SHUpdateAsync(Bian, states, sureman, suredate, remack);
        }

        //批量撤销
        [HttpPut]
        public async Task<bool> CXUpdateAsync(List<int> Bian)
        {
            return await Iws.CXUpdateAsync(Bian);
        }
    }
}
